/*
 * Dielectric.h
 *
 *  Created on: Jun 17, 2011
 *      Author: marchi
 */

#ifndef DIELECTRIC_H_
#define DIELECTRIC_H_
#include "Array.h"
#include "typedefs.h"
#include "fftw++.h"
#include "Grid.h"
using namespace Array;
using namespace fftwpp;
using std::cout;
using std::endl;

class Dielectric {
	static unsigned int nnx,nny,nnz;
	Grid<DIM> epsilon;
	void Allocate(unsigned int nx,unsigned int ny,unsigned int nz){
		nnx=nx;nny=ny;nnz=nz;
		epsilon[XX].Allocate(nnx,nny,nnz);
		epsilon[YY].Allocate(nnx,nny,nnz);
		epsilon[ZZ].Allocate(nnx,nny,nnz);
	};
public:
	Dielectric(){};
	Dielectric(unsigned int nx,unsigned int ny,unsigned int nz){
		nnx=nx;nny=ny;nnz=nz;
		epsilon[XX].Allocate(nnx,nny,nnz);
		epsilon[YY].Allocate(nnx,nny,nnz);
		epsilon[ZZ].Allocate(nnx,nny,nnz);
	}

	bool Allocated(){bool a=nnx+nny+nnz != 0; return a;};
	void Compute(Grid<DIM> &, Grid<DIM> &);
	void Print();
	virtual ~Dielectric();
};

#endif /* DIELECTRIC_H_ */
